package model.entityes.exception;

import model.UserException;

public class AllStructuresExeption extends UserException
{
    private static final long serialVersionUID = 1L;
    
    public static AllStructuresExeption getExceptionWhitUserMessage(String userMessage)
    {
	if( userMessage == null) userMessage = "";
	AllStructuresExeption err = new AllStructuresExeption();
	err.setUserException(userMessage);
	return err;
    }
    
    public static AllStructuresExeption errorGetStructure(Long id)
    {
	String idString;
	if( id == null) idString = "null";
	else idString = id.toString();
		
	String errMsg = "Ошибка получения структуры. id = " + idString;
	return AllStructuresExeption.getExceptionWhitUserMessage(errMsg);
    }
    
    public static AllStructuresExeption errorSearchStructureByTitle(String title, String exceptionString)
    {
	String idString;
	if( title == null) idString = "null";
	else idString = title.toString();
		
	String errMsg = "Ошибка поиска структры по title. title = " + idString + "\n";
	errMsg += exceptionString;
	return AllStructuresExeption.getExceptionWhitUserMessage(errMsg);
    }
    
    
}
